package com.fog.judge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fog.judge.entity.Score;
import com.fog.judge.mapper.ScoreMapper;
import com.fog.judge.service.ScoreService;
import org.springframework.stereotype.Service;

@Service
public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements ScoreService {

    @Override
    public Score findByTeacherId(int userId) {
        LambdaQueryWrapper<Score> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Score::getTeacherId, userId);
        return this.baseMapper.selectOne(queryWrapper);
    }
}
